/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.mail.store;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.B030;
import queenb.net.entitybean.M575;
import queenb.web.mail.inteface.M575Inf;
import queenb.web.store.B050Store;
import queenb.web.util.PackageContants;

/**
 *
 * @author Nguyen Hung
 */
public class M575Store extends M575 implements M575Inf {

    @Override
    public int updateM575By(int pnFH000, int pnFH200, int pnFB050, int pnPM575, int pnFF150, String pvMV576, String pvMV577, String pvMV578,
            String pvMV579, Date pdMD580, int pnMN581, String pnMV276, String pvMV282,int pnFM575, String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.UPDATE_M575, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFB050),
                        new Param(OracleTypes.INTEGER, pnPM575),
                        new Param(OracleTypes.INTEGER, pnFF150),
                        new Param(OracleTypes.CHAR, pvMV576),
                        new Param(OracleTypes.CHAR, pvMV577),
                        new Param(OracleTypes.CHAR, pvMV578),
                        new Param(OracleTypes.CHAR, pvMV579),
                        new Param(OracleTypes.DATE, pdMD580),
                        new Param(OracleTypes.INTEGER, pnMN581),
                        new Param(OracleTypes.CHAR, pnMV276),
                        new Param(OracleTypes.CHAR, pvMV282),
                        new Param(OracleTypes.INTEGER, pnFM575),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(updateStatement, M575.class);
        } catch (SQLException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    @Override
    public int updateM575N(int pnFH000, int pnFH200, int pnFB050, int pnPM575, int pnFF150, String pvMV576, String pvMV577, String pvMV578,
            String pvMV579, Date pdMD580, int pnMN581, String pvMV582, String pnMV276, String pvMV282,int pnFM575, String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.UPDATE_M575N, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFB050),
                        new Param(OracleTypes.INTEGER, pnPM575),
                        new Param(OracleTypes.INTEGER, pnFF150),
                        new Param(OracleTypes.CHAR, pvMV576),
                        new Param(OracleTypes.CHAR, pvMV577),
                        new Param(OracleTypes.CHAR, pvMV578),
                        new Param(OracleTypes.CHAR, pvMV579),
                        new Param(OracleTypes.DATE, pdMD580),
                        new Param(OracleTypes.INTEGER, pnMN581),
                        new Param(OracleTypes.CHAR, pvMV582),
                        new Param(OracleTypes.CHAR, pnMV276),
                        new Param(OracleTypes.CHAR, pvMV282),
                        new Param(OracleTypes.INTEGER, pnFM575),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(updateStatement, M575.class);
        } catch (SQLException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    @Override
    public List<M575> getListM575(int pnFH000, int pnFH200, int pnFB050, int pnPM575, String pvLOGIN) {
        return null;

    }

    @Override
    public int updateM275(int pnPM275,
            int pnFM200,
            int pnFQ100,
            String pvFM525,
            String pvMV276,
            String pvMV277,
            String pvMV278,
            int pnMN280,
            String pvMV282,
            String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.UPDATE_M275, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPM275),
                        new Param(OracleTypes.INTEGER, pnFM200),
                        new Param(OracleTypes.INTEGER, pnFQ100),
                        new Param(OracleTypes.CHAR, pvFM525),
                        new Param(OracleTypes.CHAR, pvMV276),
                        new Param(OracleTypes.CHAR, pvMV277),
                        new Param(OracleTypes.CHAR, pvMV278),
                        new Param(OracleTypes.INTEGER, pnMN280),
                        new Param(OracleTypes.CHAR, pvMV282),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(updateStatement, M575.class);
        } catch (SQLException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    public int updateM575SEVER(int pnFH000, int pnFH200, String pvMV576, String pvMV577, String pvMV578,
            String pvMV579, Date pdMD580, int pnMN581, String pnMV276, String pvMV281, String pvMV282, String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.UPDATE_M575_SEVER, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.CHAR, pvMV576),
                        new Param(OracleTypes.CHAR, pvMV577),
                        new Param(OracleTypes.CHAR, pvMV578),
                        new Param(OracleTypes.CHAR, pvMV579),
                        new Param(OracleTypes.DATE, pdMD580),
                        new Param(OracleTypes.INTEGER, pnMN581),
                        new Param(OracleTypes.CHAR, pnMV276),
                        new Param(OracleTypes.CHAR, pvMV281),
                        new Param(OracleTypes.CHAR, pvMV282),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(updateStatement, M575.class);
        } catch (SQLException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    public int updateM575SEVERN(int pnFH000, int pnFH200, String pvMV576, String pvMV577, String pvMV578,
            String pvMV579, Date pdMD580, int pnMN581, String pnMV582, String pnMV276, String pvMV281, String pvMV282,int pnFM575, String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.UPDATE_M575_SEVERN, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.CHAR, pvMV576),
                        new Param(OracleTypes.CHAR, pvMV577),
                        new Param(OracleTypes.CHAR, pvMV578),
                        new Param(OracleTypes.CHAR, pvMV579),
                        new Param(OracleTypes.DATE, pdMD580),
                        new Param(OracleTypes.INTEGER, pnMN581),
                        new Param(OracleTypes.CHAR, pnMV582),
                        new Param(OracleTypes.CHAR, pnMV276),
                        new Param(OracleTypes.CHAR, pvMV281),
                        new Param(OracleTypes.CHAR, pvMV282),
                        new Param(OracleTypes.INTEGER, pnFM575),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            
            return super.update(updateStatement, M575.class);
        } catch (SQLException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    public List<M575> getListTabM275(int pnFH000,
            int pnFH200,
            int pnFB050,
            int pnFQ100,
            int pnFM575,
            String pvFM525,
            String pvMV276,
            String pvMV277,
            String pvMV282,
            int pnOFFSET,
            int pnLIMIT,
            int pnSORT,
            int pnDIRECTION,
            String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_TABM275, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFB050),
                    new Param(OracleTypes.INTEGER, pnFQ100),
                    new Param(OracleTypes.INTEGER, pnFM575),
                    new Param(OracleTypes.CHAR, pvFM525),
                    new Param(OracleTypes.CHAR, pvMV276),
                    new Param(OracleTypes.CHAR, pvMV277),
                    new Param(OracleTypes.CHAR, pvMV282),
                    new Param(OracleTypes.INTEGER, pnOFFSET),
                    new Param(OracleTypes.INTEGER, pnLIMIT),
                    new Param(OracleTypes.INTEGER, pnSORT),
                    new Param(OracleTypes.INTEGER, pnDIRECTION),
                    new Param(OracleTypes.CHAR, pvLOGIN)});
        try {
            return super.find(dataStatement, M575.class);
        } catch (SQLException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    public List<M575> getListTabM275D(int pnFH000,
            int pnFH200,
            int pnFB050,
            int pnFQ100,
            int pnFM575,
            String pvFM525,
            String pvMV276,
            String pvMV277,
            String pvMV282,
            String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_TABM275D, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFB050),
                    new Param(OracleTypes.INTEGER, pnFQ100),
                    new Param(OracleTypes.INTEGER, pnFM575),
                    new Param(OracleTypes.CHAR, pvFM525),
                    new Param(OracleTypes.CHAR, pvMV276),
                    new Param(OracleTypes.CHAR, pvMV277),
                    new Param(OracleTypes.CHAR, pvMV282),
                    new Param(OracleTypes.CHAR, pvLOGIN)});
        try {
            return super.find(dataStatement, M575.class);
        } catch (SQLException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    public int updateM275OneColumn(String pvSchema, String pvTabName, String pvColName,
            String pnValue, String pvPrimakey, int pnCondition, String pvLogin) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.ORG_UPDATE_M275, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.CHAR, pvSchema),
                        new Param(OracleTypes.CHAR, pvTabName),
                        new Param(OracleTypes.CHAR, pvColName),
                        new Param(OracleTypes.CHAR, pnValue),
                        new Param(OracleTypes.CHAR, pvPrimakey),
                        new Param(OracleTypes.INTEGER, pnCondition),
                        new Param(OracleTypes.CHAR, pvLogin),});
            return super.updateNoOutParam(dataStatement, M575.class);
        } catch (SQLException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    public int deleteM275(int pnPM275,
            int pnFQ100,
            String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.DELETE_M275, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPM275),
                        new Param(OracleTypes.INTEGER, pnFQ100),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(updateStatement, M575.class);
        } catch (SQLException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    public int restoreM275(int pnPM275,
            int pnFQ100,
            String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.RESTORE_M275, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPM275),
                        new Param(OracleTypes.INTEGER, pnFQ100),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(updateStatement, M575.class);
        } catch (SQLException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    @Override
    public List<M575> mcurpks_listoftabm275id(int pnFH000, int pnFH200, int pnFM575, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.MCURPKS_LISTOFTABM275ID, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFM575),
 
                    new Param(OracleTypes.CHAR, pvLOGIN)});
        try {
            return super.find(dataStatement, M575.class);
        } catch (SQLException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public List<M575> mcurpks_listoftabm275ref(int pnFH000, int pnFH200, int pnFM575, String pvLOGIN) {
       DataStatement dataStatement = new DataStatement(PackageContants.MCURPKS_LISTOFTABM275REF, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFM575),
 
                    new Param(OracleTypes.CHAR, pvLOGIN)});
        try {
            return super.find(dataStatement, M575.class);
        } catch (SQLException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(M575Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
}
